#include <iostream>
using namespace std;

class A {
public:
	virtual void f1() {
		cout << "A : f1" << endl;
	}
	virtual void f2() {
		cout << "A : f2" << endl;
	}
};

class B : public A {
public:
	virtual void f1() const  {
		cout << "B : f1" << endl;
	}
	void f2() {
		cout << "B : f2" << endl;
	}
};


int main () {

	A* p1 = new B;
	B* p2 = new B;


	p1->f1();
	p1->f2();

	cout << endl;
	p2->f1();
	p2->f2();
}
